home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / mus / DASModPlayer / Rexx / makelistall.drx < prev    next >
Text File  |  1994-09-23  |  4KB  |  144 lines

  1. /*
  2.  
  3.    Make Module List, D.A.S ModulePlayer REXX-script for making modulelists!
  4.  
  5.     V0.01   Based on makelist.drx. Will print everything (except realname)
  6.  
  7.     If you want something removed or something in different order, then
  8.     you can either change it here or take examples from other makelist.drx
  9.     scripts.
  10.  
  11. */
  12.  
  13. OPTIONS Results
  14. ADDRESS 'DASMP'
  15.  
  16. signal on error
  17. signal on syntax
  18. signal on ioerr
  19. signal on break_c
  20. signal on break_d
  21.  
  22. unknownauthor = 'Unknown'
  23.  
  24. indexwidth = 4
  25. namewidth = 25
  26. authorwidth = 25
  27. stylewidth = 15
  28. timewidth = 6
  29. datewidth = 9
  30. sizewidth = 7
  31. chanwidth = 2
  32. typewidth = 8
  33. MODCOUNT
  34. modcounter=result
  35.  
  36. say ''
  37. say 'Make List All for D.A.S Moduleplayer, V0.01 by Pauli Porkka'
  38. say 'You have 'modcounter' modules in your list currently loaded to D.A.S'
  39. call writech(stdout, 'Do you want to list them all (Y/N)? ')
  40. answer = readln(stdin)
  41. answer = upper(answer)
  42. if answer='Y' then do
  43.    startlist = 0
  44.    endlist = modcounter
  45.    END
  46. else DO
  47.    call writech(stdout, 'Enter starting position (0-'modcounter')? ')
  48.    startlist = readln(stdin)
  49.    call writech(stdout, 'Enter ending position ('startlist+1'-'modcounter')? ')
  50.    endlist = readln(stdin)
  51.    END
  52.  
  53. say ''
  54.  
  55. listmode = 'ALL'
  56. call writech(stdout, 'Module list mode, ALL/KNOWN/UNKNOWN (A/K/U)?')
  57. answer = readln(stdin)
  58. answer = upper(answer)
  59. if answer='K' then listmode='KNOWN'
  60. if answer='U' then listmode='UNKNOWN'
  61.  
  62.  
  63. call writech(stdout, 'List to File or Screen (F/S)? ')
  64. answer = readln(stdin)
  65. answer = upper(answer)
  66. if answer='F' then DO
  67.    listfile='YES'
  68.    call writech(stdout, 'Enter pathfilename for the list? ')
  69.    listfilename = readln(stdin)
  70.    END
  71. else
  72.    listfile='NO'
  73.  
  74. listheader1 = left("Num", indexwidth)' 'left("Module name", namewidth)' 'left("CH", chanwidth)' 'left("Type", typewidth)' 'left("Author", authorwidth)' 'left("Style", stylewidth)' 'left("Length", timewidth)' 'left("Date", datewidth)' 'left("Size", sizewidth)
  75. listheader2 = '-----------------------------------------------------------------------------------------------'
  76.  
  77. if listfile='YES' then DO
  78.    call open(listfilehandle, listfilename, 'W')
  79.    call writeln(listfilehandle, listheader1)
  80.    call writeln(listfilehandle, listheader2)
  81.    END
  82. else DO
  83.    say listheader1
  84.    say listheader2
  85.    END
  86.    modulecount=0
  87. DO modspec= startlist to endlist
  88.  
  89.    MOVETO modspec
  90.    GETAUTHOR
  91.    authorspec=result
  92.    printline=0
  93.    if listmode='ALL' then printline=1
  94.  
  95.    if ((listmode='KNOWN') & (authorspec ~= 'Unknown')) then printline = 1
  96.  
  97.    if ((listmode='UNKNOWN') & (authorspec = 'Unknown')) then printline = 1
  98.  
  99.    if printline=1 then DO
  100.       modulecount=modulecount+1
  101.       MODNAME
  102.       namespec=result
  103.       GETSTYLE
  104.       stylespec=result
  105.       stylespec=strip(stylespec,L,'-')
  106.       GETTIME
  107.       timespec=result
  108.       GETDATE
  109.       datespec=result
  110.       GETSIZE
  111.       sizespec=result
  112.       GETTYPE
  113.       typespec=result
  114.       GETCHANS
  115.       chanspec=result
  116.       moduleline = left(modulecount, indexwidth)' 'left(namespec, namewidth)' 'left(chanspec, chanwidth)' 'left(typespec, typewidth)' 'left(authorspec, authorwidth)' 'left(stylespec, stylewidth)' 'left(timespec, timewidth)' 'left(datespec, datewidth)' 'right(sizespec, sizewidth)
  117.  
  118.       if listfile='NO' then DO
  119.          say moduleline
  120.          END
  121.       else
  122.          call writeln(listfilehandle, moduleline)
  123.    END   
  124. END 
  125.  
  126. if listfile='YES' then
  127.    call close(listfilehandle)
  128.  
  129. EXIT
  130.  
  131. error:
  132. syntax:
  133. say 'Error at line 'sigl' in MakeListAll V0.1'
  134. EXIT
  135.  
  136. break_c:
  137. break_d:
  138. say 'Received a BREAK signal, aborted...'
  139. EXIT
  140.  
  141. ioerr:
  142. say 'I/O Error at line 'sigl
  143. EXIT
  144.